When the widget is initially created (e.g. through
XXXXttttCCCCrrrreeeeaaaatttteeeeWWWWiiiiddddggggeeeetttt((((3333XXXX))))) the associated window is not actually
created. Instead, window creation is delayed until the
widget is realized. However, _g_l_X_c_h_o_o_s_e_V_i_s_u_a_l is called
immediately, so information based on its results is
available.
Between the time the widget is created and it is realized,
the following apply:
+o No OpenGL operations can be done to the window
+o No resize callbacks are generated.
+o The normal window is available (XtWindow returns NULL).
+o _G_L_w_D_r_a_w_i_n_g_A_r_e_a_M_a_k_e_C_u_r_r_e_n_t (and _g_l_X_M_a_k_e_C_u_r_r_e_n_t) should
not be called.
When the widget is realized, the following actions take
place:
+o The window is created.
+o The ggggiiiinnnniiiitttt callback is called. The user may use this
callback to perform any needed OpenGL initialization to
the window.
NNNNOOOOTTTTEEEESSSS
When using the input callback to receive keyboard input, the
keycode in the event must be converted to a KeySym. Use
XXXXLLLLooooooookkkkuuuuppppKKKKeeeeyyyyssssyyyymmmm((((3333XXXX)))) or XXXXLLLLooooooookkkkuuuuppppSSSSttttrrrriiiinnnngggg((((3333XXXX)))) to do the conversion.
Keyboard input can also be dealt using translations, in
which case no such conversion is required.
Motif programmers should keep in mind that OSF uses virtual
bindings and replaces some of the key bindings. As a common
example, if the ESC key is to be used to exit the program
(as it often is in GL programs), the translation should
specify <key>osfCancel instead of <key>Escape.
Motif programmers may also create a GLwMDrawingArea widget
with the Motif style GGGGLLLLwwwwCCCCrrrreeeeaaaatttteeeeMMMMDDDDrrrraaaawwwwiiiinnnnggggAAAArrrreeeeaaaa.
/* Perform any necessary graphics initialization.*/
}
The Motif program need only differ by including
GGGGLLLLwwwwMMMMDDDDrrrraaaawwwwiiiinnnnggggAAAArrrreeeeaaaa....hhhh instead of GGGGLLLLwwwwDDDDrrrraaaawwwwiiiinnnnggggAAAArrrreeeeaaaa....hhhh and by
creating a widget of type GGGGLLLLwwwwMMMMDDDDrrrraaaawwwwiiiinnnnggggAAAArrrreeeeaaaaWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss instead
of GGGGLLLLwwwwDDDDrrrraaaawwwwiiiinnnnggggAAAArrrreeeeaaaaWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss. As an alternative, the Motif
program could use GGGGLLLLwwwwCCCCrrrreeeeaaaatttteeeeMMMMDDDDrrrraaaawwww((((3333XXXX)))) instead.
WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
If a GLwDrawingArea widget is created as a child of an
already realized widget, the GLwDrawingArea widget will be
created immediately, without giving the user an opportunity
to add the ggggiiiinnnniiiitttt callback. In such a case, initialization
should be done immediately after creating the widget rather
than by using the callback.
If the non-Motif GLwDrawingArea widget is used in a Motif
program and keyboard traversal is attempted, the behavior is
undefined if the user traverses into the GLwDrawingArea